import scrapy


class BaiduSpider(scrapy.Spider):
    name = "baidu"
    allowed_domains = ["www.baidu.com"]  # 允许抓取的域名白名单
    start_urls = ["http://www.baidu.com/"]  # 爬虫抓取的网站地址

    def parse(self, response):
        pass


"""
1.创建项目
    scrapy startproject my_spider
    
2.创建爬虫文件
    cd my_spider
    scrapy genspider baidu baidu.com

3.启动项目
    scrapy crawl baidu
"""